package org.web.accesscontrollist.sdk.dto;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

@Setter
@Getter
public class SaveAclResourceDetailBatchDTO {

    public SaveAclResourceDetailBatchDTO(DefaultAclResourceDefinition defaultAclResourceDefinitionDTO, List<AclResourceDetailDTO> aclResourceDetailDTOList) {
        this.defaultAclResourceDefinitionDTO = defaultAclResourceDefinitionDTO;
        this.aclResourceDetailDTOList = aclResourceDetailDTOList;
        // 构建对象的同时校验参数的合法性。
        AclResourceHelper.checkSaveAclDetailBatchDTO(this);
    }

    @NotNull(message = "defaultAclResourceDefinitionDTO can't be null.")
    private DefaultAclResourceDefinition defaultAclResourceDefinitionDTO;

    @NotNull(message = "aclResourceDetailDTOList can't be null.")
    @Size(min = 1, max = 1000, message = "一次更新数据数量超过1000条上限。")
    private List<AclResourceDetailDTO> aclResourceDetailDTOList;
}

